/*
 * @Author: LVGRAPE
 * @LastEditors: LVGRAPE
 */
#ifndef _UART_H
#define _UART_H
#include "at32f421.h"

int uart_init(void);
void usart_configuration(void);
void dma_configuration(void);
uint16_t uart2_put(uint8_t *buf, uint16_t len);
uint16_t uart1_put(uint8_t *buf, uint16_t len);
uint16_t uart1_get(uint8_t *buf, uint16_t len);
uint16_t uart1_getAll(uint8_t *buf);
uint16_t uart2_get(uint8_t *buf, uint16_t len);
uint16_t uart2_getAll(uint8_t *buf);
uint8_t *uart1_rxBuff(void);
uint16_t uart1_rxLen(void);
int wait_for_uart1_rx_done_forever();
int16_t uart1_getChar(void);
uint8_t *uart1_rxbuffer(void);
uint16_t uart1_rx_length(void);
#endif /* _UART_H */
